//
//  ItemViewController.h
//  mock-store
//
//  Created by aewatson on 10/20/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Item.h"
#import "LineItem.h"
#import "Cart.h"
#import "CartViewController.h"


@interface ItemViewController : UIViewController {
    Item *item;     // current item to display
    int quantity;   // quantity of item
    Cart *cart;     // pointer to cart 
    bool editing;   // flag indicating if viewing items already in a cart
}

@property (nonatomic, retain) IBOutlet UILabel *itemName;
@property (nonatomic, retain) IBOutlet UILabel *itemDescription;
@property (nonatomic, retain) IBOutlet UILabel *itemPrice;
@property (nonatomic, retain) IBOutlet UITextField *itemQuantity;
@property (nonatomic, retain) IBOutlet UIButton *quantityAdd;
@property (nonatomic, retain) IBOutlet UIButton *quantitySubtract;
@property (nonatomic, retain) IBOutlet UIButton *addToCart;
@property (nonatomic, retain) Item *item;
@property (nonatomic, retain) Cart *cart;
@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;
@property bool editing;

-(void)setQuantity: (int)newQuantity;   // sets item quantity
-(int)getQuantity;                      
-(NSString*)getQuantityString;          
-(IBAction)btnQtyAddClicked;            // button qty added listener
-(IBAction)btnQtySubClicked;            // button qty subtracted listener
-(IBAction)btnAddToCartClicked;         // button add to cart listener
-(void) btnViewCartClicked;             // button view cart listener

@end
